package org.googlecode.gwt.wii.memory.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.PushButton;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.Widget;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class Memory implements EntryPoint {
	
	public void onModuleLoad() {
		
		RootPanel rootPanel = RootPanel.get();
		
		final MemoryGame memoryGame = new MemoryGame(8, 4, 4);
		rootPanel.add(memoryGame, 14, 11);
		memoryGame.setSize("582px", "445px");
		

		final PushButton restPushButton = new PushButton();
		rootPanel.add(restPushButton, 200, 480);
		restPushButton.setText("Reset");
		restPushButton.addClickListener(new ClickListener() {
			public void onClick(final Widget sender) {
				if( Window.confirm("Sei sicuro ?") )
				{
					memoryGame.reset();					
				}
			}
		});
	}
}
